package com.codejiwei.flink.practice;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author jiwei
 * @description
 * @date 2023/5/19 17:03
 */
public class Flink_Transform_Filter {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
//        env.fromElements(10, 3, 5, 9, 18, 29)
//                .filter(new FilterFunction<Integer>() {
//                    @Override
//                    public boolean filter(Integer integer) throws Exception {
//                        return integer % 2 == 0;
//                    }
//                })
//                .print();

        env.fromElements(10, 3, 5, 9, 18, 29)
                .filter(value -> value % 2 == 0)
                .print();

        env.execute();
    }
}
